home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_300 / 331_01 / ged.h < prev    next >
Text File  |  1990-06-13  |  16KB  |  378 lines

  1. /*
  2. HEADER:         CUG000.01;
  3. TITLE:          header file for se.c;
  4. DATE:           5/19/87;
  5. FILENAME:       GED.H;
  6. AUTHORS:        G. Nigel Gilbert, James W. Haefner, Mel Tearle G. Osborn;
  7. */
  8.  
  9. /*
  10.      e/qed/ged screen editor
  11.  
  12.     (C) G. Nigel Gilbert, MICROLOGY, 1981
  13.            licensed for private non-profitmaking use 1983
  14.            August-December 1981
  15.  
  16.     Modified: Aug-Dec   1984:  BDS-C 'e'(vers 4.6a) to 'qe' (J.W. Haefner)
  17.               March     1985:  BDS-C 'qe' to DeSmet-C 'qed' (J.W.Haefner)
  18.               May       1986:  converted to ged - Mel Tearle
  19.               June      1990:  G. Osborn
  20.     FILE:     ged.h
  21.  
  22.     PURPOSE:  standard header file, #included in all function files
  23. */
  24.  
  25. /*
  26.  * All static variables and #defines were at one time in this file.
  27.  * Variables which are not truely global in function are being removed
  28.  * from here and placed in the individual files.  Parameters which, though
  29.  * sometimes local, are useful for configuring the program without studying
  30.  * the details remain here.     g.o.
  31.  */
  32.  
  33.  
  34. #define max(a,b) (a >= b) ? a : b
  35. #define min(a,b) (a <= b) ? a : b
  36. #define abs(x)   (x >= 0) ? x : -x
  37.  
  38. #define VERSION   "4.6b"
  39.  
  40. /* Microsoft 4.00 mixed memory model */
  41. #define FAR far
  42. #define HUGE huge
  43. /* use the following two lines instead of the preceeding two if the compiler
  44.  * does not support mixed memory models.  The empty definitions
  45.  * remove all occurences of the far and huge keyword, causing
  46.  * the small memory model to be used.
  47.  */
  48. /*
  49.  *#define FAR
  50.  *#define HUGE
  51.  */
  52.  
  53.  
  54.  
  55. #define SECSIZ      512      /* file buffer definitions */
  56. #define NSECTS        4
  57. #define FILELEN      64      /* max length of file name */
  58.  
  59. #define JBUFSIZE   6     /* size of buffer required for longjumps, not used */
  60. #define BUFFER    12     /* size of typeahead buffer */
  61. #define FLIM      80     /*  */
  62. #define LLIM     255     /* max length of a line. count includes null marker */
  63.  
  64. #define FAIL      -1
  65. /* disc fail.  This value is internal and compiler independent */
  66. #define DFAIL     -2
  67. #define ENDCHAR    0x1a    /* end of text file mark. automatic option on input */
  68. #define ENDFILE    -1      /* end of input file */
  69. #define YES        1
  70. #define NO         0
  71. #define FALSE      0
  72. #define TRUE       1
  73. #define PREV      -2
  74.  
  75. #define PAGEOVERLAP   0    /* overlap between pages with UP,DOWN-PAGE */
  76. #define OFFWIDTH      1    /* horizontal scroll increment */
  77.  
  78. #define SHEIGHT      24    /* screen height */
  79. #define SWIDTH       79    /* screen width */
  80.  
  81. #define NLINES        6    /* number of lines to skip at bottom of printer page */
  82. #define PAGELEN      66    /* length of printer page, used in listfile() & roff() */
  83.  
  84. #define EMPOS         0    /* position of error message */
  85. #define WAITPOS       0    /* position of cursor when searching/reading */
  86. #define LNPOS         7    /* position of line number */
  87. #define COLPOS       18    /* position of column number */
  88. #define REPPOS       19
  89. #define FNPOS        43    /* status line - position of file name */
  90. #define TIMEPOS      72    /* position of current time */
  91.  
  92. #define BACKSP     0x08    /* backspace */
  93. #define CTRL       0x1f    /* last control char */
  94. #define PARBIT     0x80    /* parity bit used as a flag by testkey() */
  95. #define NKEYS        32    /* number of key codes */
  96.  
  97. #define HISTLEN     100    /* history stack of commands for undoing */
  98. #define HISTINSERT    1    /* type of command on history stack */
  99. #define HISTDELETE    2
  100. #define HISTREPLACE   3
  101.  
  102. /* Internal key codes - recommended key assignments in brackets
  103.  */
  104. #define LEADIN     0     /* lead in chararacter to key codes -
  105. ignored, but following key code parity set */
  106. #define DOWNKEY    1     /* cursor down */
  107. #define UPKEY      2     /* cursor up */
  108. #define LEFTKEY    3     /* cursor left */
  109. #define RIGHTKEY   4     /* cursor right */
  110. #define RIGHTWKEY  5     /* cursor right one word (D) */
  111. #define LEFTWKEY   6     /* cursor left one word (S) */
  112. #define EOLKEY     7     /* cursor to end of line (E) */
  113. #define BOLKEY     8     /* cursor to beginning of line (B) */
  114. #define UPPAGE     9     /* scroll up a page (W) */
  115. #define DOWNPAGE  10     /* scroll down a page (Z) */
  116. #define BOFKEY    11     /* cursor to beginning of file (U) */
  117. #define HOMEKEY   12     /* cursor to end of file (HOME) */
  118. #define DELLEFT   13     /* delete char to left of cursor (DEL) */
  119. #define DELRIGHT  14     /* delete char under cursor (G) */
  120. #define DELLNKEY  15     /* delete cursor line (Y) */
  121. #define DELWDKEY  16     /* delete word to right of cursor (T) */
  122. #define JUMPKEY   17     /* jump to (X) */
  123. #define CRSTILL   18     /* insert newline after cursor (N) */
  124. #define QWIKKEY   19     /* quit (Q) */
  125. #define WINDUP    20     /* window up one line */
  126. #define TOPSCRKEY 1000   /*not fully implemented  */
  127. #define BOTSCRKEY 1001   /*  */
  128. #define POP       21
  129. #define CPOP      22
  130. #define BLOCKKEY  23     /* block operations (K) */
  131. #define WINDDOWN  24     /* window down one line */
  132. #define REPKEY    25     /* repeat last find/alter (L) */
  133. #define INSKEY    26     /* char insert/replace */
  134. #define OOPSKEY   27     /* restore unedited line (_) */
  135. #define TAB       28     /* tab (I) */
  136. #define RETRIEVE  29     /* retrieve last name etc entered here */
  137. #define CR        30     /* return (M) */
  138. #define ESCKEY    31     /* the magic escape key (ESC) */
  139. #define HELPKEY   1002   /* not implemented.  The F1 help key is implemeted. */
  140.  
  141. /* key codes + 0x80 (PARBIT) - used in scanning strings of ctrl chars */
  142. #define LEFTKEY_P   131
  143. #define DELLEFT_P   141
  144. #define RETRIEVE_P  157
  145. #define CR_P        158
  146. #define ESCKEY_P    159
  147.  
  148. /* function keys */
  149. #define F1KEY     210
  150. #define F2KEY     211  /* f2 = search */
  151. #define F3KEY     212  /* f3=backward */
  152. #define F4KEY     213  /* f4=forward  */
  153. #define F5KEY     214
  154. #define F6KEY     215
  155. #define F7KEY     216
  156. #define F8KEY     217
  157. #define F9KEY     218   /* f9 exit */
  158. #define F10KEY    219   /* f10 save */
  159.  
  160. /*
  161.  * The video parameters in this file were originally set for a Hercules
  162.  * video card, then changed for a VGA card with a NEC grey scale monitor.
  163.  * The UNDERLINE attribute was used for the status line on the Hercules
  164.  * card, but is not supported by the VGA card.  The values selected in
  165.  * this version will work on all systems, but are not the best choices
  166.  * for any one system.  The first four bits and the second four bits of
  167.  * the attribute byte are independently selected.  Experiment with them.
  168.  */
  169.  
  170. /*
  171.  * normal screen color/intensity.  selected by a call to colornorm()
  172.  */
  173. #define ATTR0  0x07    /* PC default.  White on black.*/
  174.  
  175. /* a screen attribute used like highlighting or italics.
  176.  * The significance to the program is that it is abnormal, not whether it
  177.  * is bright or dim.  On the PC it is brighter than normal.
  178.  * Selected by a call to color1();
  179.  */
  180. #define ATTR1 0x0F    /* bright white on black */
  181.  
  182. /* Reverse field.  Used for marking blocks and for error messages.  Affects
  183.  * whitespace so that the spaces within block boundaries can be seen.
  184.  * Selected by a call to colorblock().  Also selected by colorerr(); in
  185.  * this version.  (0x70 and 0x78 are the only codes which will reverse
  186.  * field a PC monochrome display, excluding colored error messages if
  187.  * compatibility is a consideration).
  188.  */
  189. #define ATTR2 0x70   /* reverse field, normal intensity */
  190.  
  191. /* Was used only to underline the header to seperate it from the
  192.  * text.  Could also be used for conventional underlining of text.
  193.  */
  194. /* #define ATTR3 0x01 */    /* normal intensity, underlined (Hercules & other early cards) */
  195. /* vga, temporary +++ */
  196. #define ATTR3 0x70
  197.  
  198. /*#define ATTR4 0x09 */    /* bright and underlined (Hercules) */
  199. /* vga grey scale for header, temporary +++ */
  200. #define ATTR4 0x60
  201.  
  202. /* Virtual memory constants.  The following are sized with a fixed
  203.  * disc system and 640kb of RAM in mind.  There is a small memory savings in
  204.  * reducing the magnitude of the constants for smaller systems,
  205.  * but, other than for optimizaton, it is not nec